package com.xy.entity.test;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by Thinkpad on 2018/1/12.
 */
@Entity
@Data
@EqualsAndHashCode(exclude ={"t2","t3"})
public class T1 {
    @Id
    private String id ;

    private String name;

    @OneToMany(mappedBy = "t1", cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    private Set<T2> t2 = new HashSet<>();

    @OneToMany(mappedBy = "t1", cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    private Set<T3> t3 = new HashSet<>();
}
